//
//  AreaHotCell.m
//  penzer
//
//  Created by caiyc on 2018/10/14.
//  Copyright © 2018年 caiyc. All rights reserved.
//

#import "AreaHotCell.h"

@implementation AreaHotCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(void)bindData:(NSArray *)citys{
    CGFloat startY = 115;
    CGFloat width  = screen_width/3-40;
    for(int i =0;i<citys.count;i++){
        UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
        btn.frame = CGRectMake(width*(i%3)+(i%3+1)*10, 115+50*(i/3), width, 40);
       [ btn setTitle:citys[i][@"name"] forState:UIControlStateNormal];
        [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        [self.contentView addSubview:btn];
    [btn setBackgroundColor:[UIColor whiteColor]];
        btn.titleLabel.font = [UIFont systemFontOfSize:14];
        btn.tag = i;
        [btn addTarget:self action:@selector(selct:) forControlEvents:UIControlEventTouchUpInside];
    }
    
}
-(void)selct:(UIButton *)sender{
        self.slecty(sender.tag);
    }
@end
